/**
 * @file   MiraPlacement2D.cpp
 * @author Josep Sabater (jsabaterm@el.ub.edu)
 * @date   October, 2015
 * @version 1.0.0
 * @ingroup MiraGeometryLib
 * @brief  Struct for a given 2D object placement
 *
 * Contains the placement (position + orientation)
 */
#include <ostream>

#include "MiraPlacement2D.h"

namespace MiraGeometryLib{

    /** Non-member friend function for << operator
     */
    std::ostream& operator << (std::ostream& os, const Placement2D& place){
        return os << "Placement2D: " << place.pos << " - " << place.orient;
    }
    
    
    bool Placement2D::operator == (const Placement2D& p) const {
        return (pos==p.pos && orient==p.orient);
    }

    bool Placement2D::operator != (const Placement2D& p) const {
        return (pos!=p.pos || orient!=p.orient);
    }
    
   Placement2D::Place2DCont_t Placement2D::fromDouble(const MiraUtilUBLib::DoubleCont_t &dCont){
       Placement2D::Place2DCont_t placeCont;
       for(auto d : dCont)
           placeCont.push_back( Placement2D(d) );
       return placeCont;
   }
}
